#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef double db;

#define in read()
#define pii pair<int,int>
#define fi first
#define se second
#define FILE(x) freopen(x".in","r",stdin);\
	freopen(x".out","w",stdout);
#define pb push_back

int read(){
	int x = 0,sgn = 1;char ch = getchar();
	for(;!isdigit(ch);ch = getchar()) if(ch == '-') sgn = -1;
	for(;isdigit(ch);ch = getchar()) x = (x<<1)+(x<<3)+(ch^48);
	return x*sgn;
}

const int D = 80010;

int mat[D],h[D],n,m,cnt,nodenum,tot,ans,ri[210][210],dn[210][210];
bool vis[D];
char s[210][210];

struct edge{int v,nxt;}e[D<<3];
void link(int x,int y){e[++cnt] = (edge){y,h[x]};h[x] = cnt;}

bool dfs(int x){
	for(int i = h[x],y;i;i=e[i].nxt){
		if(!vis[y = e[i].v]){
			vis[y] = 1;
			if(!mat[y] || dfs(mat[y])){
				mat[y] = x;
				return 1;
			}
		}
	}return 0;
}

int main (){
#ifndef ONLINE_JUDGE
	freopen("1.in","r",stdin);
#endif
	n = in,m = in;
	for(int i = 1;i <= n;i++)
		scanf("%s",s[i]+1);
	nodenum = 0; 
	for(int i = 1;i <= n;i++)
		for(int j = 1;j <= m;j++){
			if(s[i][j] == '.') continue;
			tot++;
			int hi[2]={0,0},li[2]={0,0};
			if(s[i][j-1] == '#') hi[0] = ri[i][j-1];
			if(s[i][j+1] == '#') hi[1] = ri[i][j] = ++nodenum;
			if(s[i-1][j] == '#') li[0] = dn[i-1][j];
			if(s[i+1][j] == '#') li[1] = dn[i][j] = ++nodenum;
			for(int k = 0;k < 2;k++)
				for(int d = 0;d < 2;d++){
					int x = hi[k],y = li[d];
					if(!x || !y) continue;
					link(x,y);//cout<<x<<"->"<<y<<endl;
				}
		}
	int ans = 0;
	for(int i = 1;i <= nodenum;i++) {
		memset(vis,0,sizeof(vis));
		if(dfs(i)) ans++;
	}
	ans = nodenum - ans; //cout<<nodenum<<" "<<ans<<endl;
	printf("%d\n",tot - ans);
	return 0;
}

